Initialise offsetopt when offset == 0. Closes bug #599.
authoremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Mon, 10 Apr 2006 15:28:52 +0000 (16:28 +0100)
committeremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Mon, 10 Apr 2006 15:28:52 +0000 (16:28 +0100)
Report and diagnosis by Robert Hendrickx <robert.hendrickx@advalvas.be>.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/pygrub/src/fsys/ext2/ext2module.c

index 63d20f298384d02063aa4a6f5001c5f4fb215bc2..57f1a83eaf47a8417d7812bc9af12a7814e6f824 100644 (file)
@@ -228,7 +228,10 @@ ext2_fs_open (Ext2Fs *fs, PyObject *args, PyObject *kwargs)
     }
 
 #ifdef HAVE_EXT2FS_OPEN2
-    if (offset != 0) {
+    if (offset == 0) {
+        offsetopt[0] = '\0';
+    }
+    else {
         snprintf(offsetopt, 29, "offset=%d", offset);
     }